<script setup lang="ts" name="CCParentPage_Props">
import { ref } from "vue";
import Child from "./Child.vue";

const car = ref("大本");
const toy = ref<string>();

const getToy = (receivedToy: string) => {
  toy.value = receivedToy;
};
</script>

<template>
  <div class="bg-sky-100 p-6">
    <h2 class="text-xl">父组件</h2>
    <div>车：{{ car }}</div>
    <div v-if="toy">子组件的玩具：{{ toy }}</div>
    <Child :car="car" :sendToy="getToy" />
  </div>
</template>
